//
//  Timer.cpp
//  EidoTron
//
//  Created by Luca Di Franco on 28/06/11.
//  Copyright 2011 Luca Di Franco. All rights reserved.
//

#include "Timer.h"

Uint32 Timer::lastTime = 0;

float Timer::lastLap = 0.0f;

float Timer::lap()
{
	if (lastTime == 0)
		lastTime = SDL_GetTicks();
	Uint32 currentTime = SDL_GetTicks();
	lastLap = (float)(currentTime - lastTime) * 0.001f;
	lastTime = currentTime;
	return lastLap;
}

float Timer::getLastLap()
{
	return lastLap;
}